package com.sf.fy.uav.common.enums;

import lombok.Getter;

/**
 * @author ta136817
 */
@Getter
public enum CouponSourceEnum {
    /**
     * 领券方式枚举
     */
    USER_CLAIM("用户领取",1),
    ORIENTATION_GRANT("定向发放",2);

    private final String desc;
    private Integer value;

    public void setValue(Integer value) {
        this.value = value;
    }

    CouponSourceEnum(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }

    public static String getDesc(Integer value) {
        for (CouponSourceEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.getDesc();
            }
        }
        return null;
    }
}
